@extends('shop-backend::layouts.bootstrap_modal')

@section('modal_class')
    modal-md
@stop
@section('title')
    批量编辑商品
@stop

{!! Html::style(env("APP_URL").'/assets/backend/libs/dategrangepicker/daterangepicker.css') !!}

@section('body')
    <div class="row">
        <form class="form-horizontal" method="post" id="base-form" action="{{route('admin.shop.goods.saveBatchGoods')}}">
            {{csrf_field()}}
            <input type="hidden" name="ids" value="{{$ids}}">
            <input type="hidden" name="value" value="{{$value}}">
            <input type="hidden" name="sold_out" value="{{$sold_out}}">
            <input type="hidden" name="shop_id" value="{{$shop_id}}">
            <div class="col-md-10">
                <div class="form-group">
                    <label class="col-sm-4 control-label">是否可使用积分抵扣：</label>
                    <div class="col-sm-8">
                        <label class="control-label">
                            <input type="radio" value="1" name="point_deduction">
                            是
                            &nbsp;&nbsp;
                            <input type="radio" value="0" name="point_deduction" checked>
                            否
                        </label>
                    </div>
                </div>
            </div>

            <div class="col-md-10">
                <div class="form-group">
                    <label class="col-sm-4 control-label">是否可获得积分：</label>
                    <div class="col-sm-8">
                        <label class="control-label">
                            <input type="radio" value="1" name="can_get_point">
                            是
                            &nbsp;&nbsp;
                            <input type="radio" value="0" name="can_get_point" checked>
                            否
                        </label>
                    </div>
                </div>
            </div>

            <div class="col-md-10">
                <div class="form-group">
                    <label class="col-sm-4 control-label">是否特价：</label>
                    <div class="col-sm-8">
                        <label class="control-label">
                            <input type="radio" value="1" name="is_discount">
                            是
                            &nbsp;&nbsp;
                            <input type="radio" value="0" name="is_discount" checked>
                            否
                        </label>
                    </div>
                </div>
            </div>
        </form>
    </div>
@stop

{!! Html::script(env("APP_URL").'/assets/backend/libs/jquery.form.min.js') !!}

@section('footer')
    <button type="button" class="btn btn-link" data-dismiss="modal">取消</button>
    <button type="submit" class="btn btn-primary" data-toggle="form-submit" data-target="#base-form">提交</button>
    <script>


        $('#base-form').ajaxForm({
	        success: function (res) {
		        if (res.status) {
			        swal({
				        title: "设置成功！",
				        text: "",
				        type: "success"
			        }, function () {
				        location.reload();
			        });
		        } else {
			        swal("保存失败!", res.message, "error");
		        }
	        }
        });
    </script>
@stop